package cn.iocoder.yudao.framework.common.enums.pay;

import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import com.google.common.base.Objects;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum PayorderDetailStatusEnum implements ArrayValuable<Integer> {
    WAITING(0, "未支付"),
    SUCCESS(10, "成功支付"),
    PART_SUCCESS(11, "部分支付"),
    CLOSED(20, "支付关闭"),
    FAIL(30, "支付失败"),
    ;
    private final Integer status;
    private final String name;

    public static boolean isClosed(Integer status) {
        return Objects.equal(status, CLOSED.getStatus());
    }

    public static boolean isOrderSuccess(Integer status) {
        return Objects.equal(status, SUCCESS.getStatus());
    }

    @Override
    public Integer[] array() {
        return new Integer[0];
    }
}
